
<div class="panel panel-default panel-intro">

    {:build_heading()}
    <div class="panel-body">
        <div id="myTabContent" class="tab-content" >
            <div class="tab-pane fade active in" id="one">
                <div class="widget-body no-padding">
                    <form class="form-inline">
                        <div class="row" style="font-weight:400;">
                            <div class="form-group">
                                <label for="exampleInputName2" style="font-weight:400;width:80px">商品ID：</label>
                                <input type="text" class="form-control" name="name_keyword" style="margin-right:14px" id="exampleInputNameid" placeholder="商品ID">
                            </div>
                            <div class="form-group">
                                <label for="exampleInputName2" style="font-weight:400;margin-left:10px;width:80px">商品名称：</label>
                                <input type="text" class="form-control" name="name" id="exampleInputName2" placeholder="商品昵称" style="margin-right:10px">
                            </div>
                            <div class="form-group">
                                <label for="exampleInputSerial2" style="font-weight:400;">零件编号：</label>
                                <input type="text" class="form-control" name="SerialNum" id="exampleInputSerial2" placeholder="零件编号">
                            </div>
                           <div style="margin-top:20px">
                              <div class="form-group">
                                <label for="createtime" style="font-weight:400;width:80px">创建时间：</label>
                                <input id="createtime" name="createtime" type="date" style="width: 185px;color:#808080"  placeholder="创建时间" />
                            </div>

                            <div class="form-group">
                                <label for="endtime" style="font-weight:400;width:80px;margin-left:10px">结束时间：</label>
                                <input id="endtime" name="endtime" type="date"  style="width: 185px;color:#808080;" placeholder="结束时间" />
                            </div>
                            </div>
                        </div>

                <p></p>
                        <!--<div class="row">-->
                          
                        <!--</div>-->
                    <!--<p></p>-->
                        <div class="row">
                            <div class="form-group">
                                <label for="exampleInputSearname2" style="font-weight:400;width:80px">快速筛选：</label>
                                <select class="form-control" name="refundName" style="width:185px">
                                    <option value="" style="color:#808080">无</option>
                                    {foreach name="$refundWhy" item="vo"}
                                    <option value="{$vo}">{$vo}</option>
                                    {/foreach}
                                </select>
                            </div>
                            <!--<div class="form-group">-->
                                <label for="exampleInputSearname2" style="font-weight:400;margin-left:10px">精选查询：</label>
                                <input type="text" class="form-control" name="searname" id="exampleInputSearname2" value="{$searname}" style="width:300px;margin-left:10px"  placeholder="请输入买家昵称/订单编号/收货手机号">
                            <!--</div>-->
                            <!--&nbsp;&nbsp;&nbsp;-->
                            <a href="javascript:;" class="btn btn-primary btn-refresh" title="{:__('Refresh')}" ><i class="fa fa-refresh"></i> </a>

                            <a href="{:url('order/sale/index')}" class="btn btn-default" style="font-size: 14px; ">
                            <span class="extend" class="btn btn-default">
                                重置
                            </span>
                            </a>
                            <button type="submit" class="btn btn-default">搜索</button>
                            <button type="submit" id="export" value="导出" style="height: 32.56px">批量导出</button>
                        </div>

                        <p></p>

                    </form>
                    <div id="toolbar" class="toolbar">

                    </div>

                    <div class="row" >
                        <ul class="nav nav-tabs">
                            {foreach name="typeList" item="vo"}
                            {if condition="$key != 3"}
                            <li class="{:$Think.get.status === (string)$key ? 'active' : ''}">
                                <a href="{:url('order/sale/index')}?status={$key}&page=1&"
                                   data-value="{$key}" style="color: #0d0d0d;">{$vo}</a>
                            </li>
                            {/if}
                            {/foreach}
                        </ul>
<!--                        <div class="col-xs-1 col-sm-6">-->
<!--                            <a href="{:url('order/sale/index')}" style="color: #0d0d0d;">全部订单</a>-->
<!--                            &nbsp;-->
<!--                            <a href="{:url('order/sale/index')}?status=2" style="color: #0d0d0d;">未发货</a>-->
<!--                                &nbsp;-->
<!--                            <a href="{:url('order/sale/index')}?status=3" style="color: #0d0d0d;">已发货</a>-->
<!--                        </div>-->

                    </div>

                    <table id="table" class="table " style="min-width:1058px; "
                           width="100%" >

                        <thead>

                            <tr>
                                <th colspan="2" style="font-weight:400; text-align: center;border: 1px solid #f4f4f4;">商品</th>
                                <th style="font-weight:400; text-align: center;border: 1px solid #f4f4f4;">规格</th>
                                <th style="font-weight:400; text-align: center;border: 1px solid #f4f4f4;">交易金额</th>
                                <th style="font-weight:400; text-align: center;border: 1px solid #f4f4f4;">退款金额</th>
                                <th style="font-weight:400; text-align: center;border: 1px solid #f4f4f4;">退款状态</th>
                                <th style="font-weight:400; width: 45px; text-align: center;border: 1px solid #f4f4f4;">买家</th>
                                <th style="font-weight:400; text-align: center;border: 1px solid #f4f4f4;">退款原因</th>
                                <th style="font-weight:400; text-align: center;border: 1px solid #f4f4f4;">操作</th>
                            </tr>
                        </thead>
                        <tbody>
                        {foreach name= "rows" item="vo"}
                       
                      <!--<tr>-->
                      <!--          <th colspan="2" style="font-weight:400; text-align: center;border: 1px solid #f4f4f4;">-->
                      <!--            {$vo.goods_id}-->
                      <!--          </th>-->
                      <!--            <th style="font-weight:400; text-align: center;border: 1px solid #f4f4f4;">-->
                      <!--            {$vo.item_name}-->
                      <!--          </th>-->
                      <!--               <th style="font-weight:400; text-align: center;border: 1px solid #f4f4f4;">-->
                      <!--            {$vo.orderData.goods_pay_price}-->
                      <!--          </th>-->
                      <!--            <th style="font-weight:400; text-align: center;border: 1px solid #f4f4f4;">-->
                      <!--            {$vo.refund_price}-->
                      <!--          </th>-->
                      <!--                 <th style="text-align: center; font-weight:400;border: 1px solid #f4f4f4;">{if condition = "$vo.status == 0" }-->
                      <!--                  未审核-->
                      <!--              {elseif condition="$vo.status == 1" /}-->
                      <!--                  商家拒绝退款-->
                      <!--              {elseif condition="$vo.status == 2"}-->
                      <!--                  待发货-->
                      <!--                  商品待退货-->
                      <!--              {elseif condition="$vo.status == 3"}-->
                      <!--                  已发货-->
                      <!--                  商家待收货-->
                      <!--              {elseif condition="$vo.status == 4"}-->
                      <!--                  商家拒绝退款-->
                      <!--              {elseif condition="$vo.status == 5"}-->
                      <!--                  等待退款-->
                      <!--              {elseif condition="$vo.status == 6"}-->
                      <!--                  退款成功-->
                      <!--              {elseif condition="$vo.status == 7"}-->
                      <!--                  已收货-->
                      <!--              {/if}-->
                      <!--          </th>-->
                      <!--           <th style="text-align: center; font-weight:400;border: 1px solid #f4f4f4;">{$vo.orderData.name}</th>-->
                      <!--            <th style="text-align: center; font-weight:400;border: 1px solid #f4f4f4;">{$vo.refund_reason}</th>-->
                      <!--          </tr>-->
                    
                            <tr>
                                <th colspan="2" style="font-weight:400;border: 1px solid #f4f4f4;">订单编号：{$vo.refund_sn}</th>
                                <th colspan="7" style="font-weight:400;border: 1px solid #f4f4f4;">创建时间：{$vo.create_time|datetime}</th>
                            </tr>
                            <tr>
                                <th width="80"> <img src="{$vo.ordergoods.goods_image}" width="80px" height="80px"> </th>
                                <th style="width: 300px;text-align: center; font-weight:400;border: 1px solid #f4f4f4;" >{$vo.goods_id}</th>
                                <th style="text-align : center; font-weight:400;border: 1px solid #f4f4f4;" width="120px">
                                    {foreach name= "vo.itemsku.spec" item="vosku"}
                                        {$vosku.name} : {$vosku.value} <br>
                                    {/foreach}
                                </th>
                                <th style="text-align: center; font-weight:400;border: 1px solid #f4f4f4;" width="100px">{$vo.orderData.goods_pay_price}</th>
                                <th style="text-align: center; font-weight:400;border: 1px solid #f4f4f4;" width="100px">{$vo.refund_price}</th>

                                <th style="text-align: center; font-weight:400;border: 1px solid #f4f4f4;">{if condition = "$vo.status == 0" }
                                        未审核
                                    {elseif condition="$vo.status == 1" /}
                                        商家拒绝退款
                                    {elseif condition="$vo.status == 2"}
                                        待发货
                                        商品待退货
                                    {elseif condition="$vo.status == 3"}
                                        已发货
                                        商家待收货
                                    {elseif condition="$vo.status == 4"}
                                        商家拒绝退款
                                    {elseif condition="$vo.status == 5"}
                                        等待退款
                                    {elseif condition="$vo.status == 6"}
                                        退款成功
                                    {elseif condition="$vo.status == 7"}
                                        已收货
                                    {/if}
                                </th>
                                <th style="text-align: center; font-weight:400;border: 1px solid #f4f4f4;">{$vo.orderData.name}</th>
                                <th style="text-align: center; font-weight:400;border: 1px solid #f4f4f4;">{$vo.refund_reason}</th>
                                <th style="text-align:center;vertical-align:middle;padding-top:20px;border: 1px solid #f4f4f4;">
                                    <p>
                                        <a data-url="{:url('order/sale/edit')}?ids={$vo.id}" class="btn-dialog btn btn-xs btn-primary shows" style="background-color: #18bc9c;">详情</a>
                                    </p>
                                    {if condition="$vo.invoice_no != null"}
                                        <p>
                                            <a href="{:url('order/courier/courierselect')}?ids={$vo.order_id}" class="btn-dialog btn btn-xs btn-primary" style="background-color: #f75444;"><span>查看物流</span></a>
                                        </p>
<!--                                        <p>-->
<!--                                            <a href="{:url('order/sale/refused')}?ids={$vo.id}&status=1"><span>拒绝</span></a>-->
<!--                                        </p>-->
                                    {/if}
                                    {if condition="$vo.status==0"}
                                        <p>
                                            <a href="{:url('order/sale/refused')}?ids={$vo.id}&status=1" class="btn-dialog btn btn-xs btn-primary" style="background-color: #18bc9c;"><span>拒绝</span></a>
                                        </p>
                                        <p>
                                            <a href="{:url('order/sale/refused')}?ids={$vo.id}&status=2" class="btn-dialog btn btn-xs btn-primary" style="background-color: #f75444;"><span>同意</span></a>
                                        </p>
                                    {/if}

    
                                    {if condition="$vo.status == 5 || $vo.status == 2 " }
                                        <p>
                                            <a href="{:url('order/sale/refund')}?ids={$vo.id}&status=6" class="btn-dialog btn btn-xs btn-primary" style="background-color: #18bc9c;"><span>确认退款</span></a>
                                        </p>

<!--                                        <p>-->
<!--                                            <a href="{:url('order/sale/refused')}?ids={$vo.id}&status=1"><span>拒绝</span></a>-->
<!--                                        </p>-->
                                    {/if}

                                    {if condition="$vo.status == 3"}
                                        <p>
                                            <a href="{:url('order/sale/refused')}?ids={$vo.id}&status=5" class="btn-dialog btn btn-xs btn-primary" style="background-color: #f75444;"><span> 确认</span></a>
                                        </p>
                                        <p>
                                            <a href="{:url('order/sale/refused')}?ids={$vo.id}&status=4" class="btn-dialog btn btn-xs btn-primary" style="background-color: #18bc9c;"><span> 拒绝</span></a>
                                        </p>
                                    {/if}
                                </th>

                            </tr>
                        {/foreach}
                        </tbody>

                    </table>
                    <div class="page">
                        {$page}
                    </div>

                </div>
            </div>

        </div>
    </div>
</div>
<script src="https://cdn.jsdelivr.net/npm/jquery@1.12.4/dist/jquery.min.js"></script>
<script>
    $('#export').click(function(){
        $("#table").tableExport({
            type: 'excel',
            escape: 'true',
            fileName: '售后列表',
            ignoreColumn: [8] //删除第八列
        })

    })
</script>
<style>
    .form-group{
        width:320px;
    }
</style>
